package com.ruoyi.project.wenyanwen.generate.convert;


import com.ruoyi.project.wenyanwen.generate.domain.sqlite.TagSqlite;
import com.ruoyi.project.wenyanwen.tag.domain.ArticleTag;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jackyshi
 */
public class TagConvert extends AbstractConvert {

    @Override
    public List<TagSqlite> convert(List<?> list) {

        List<TagSqlite> l = new ArrayList<>();

        for (Object obj : list) {

            ArticleTag tag = (ArticleTag) obj;
            TagSqlite model = new TagSqlite();
            model.setTagId(tag.getTagId().intValue());
            model.setParentTagId(tag.getParentTagId().intValue());
            model.setName(tag.getName());
            model.setIntroduction(tag.getIntroduction());
            l.add(model);
        }

        return l;
    }
}
